<template>
    <div class="h-full flex-col">
        <SearchForm @handle-reset="resetParams" @handle-search="getList">
            <el-form :model="searchForm" inline>

                <el-form-item>
                    <el-input v-model="searchForm.phone" class="w-220px" clearable @change="getList"
                        placeholder="用户手机号" />
                </el-form-item>
            </el-form>
        </SearchForm>
        <div class="page-card h-full" v-loading="loading">
            <el-table :data="tableData">
                <el-table-column label="ID" prop="_id" align="center" />
                <el-table-column label="手机号" prop="phone" align="center" />
                <el-table-column label="积分" prop="remainScore" align="center" />
                <el-table-column label="赠送积分" prop="remainSendScore" align="center" />
                <el-table-column label="次数" prop="remainCount" align="center" />
                <el-table-column label="赠送次数" prop="remainSendCount" align="center" />
                <el-table-column label="短信余额" prop="smsNum" align="center" />
                <el-table-column label="接受短信手机号" prop="usePhone" align="center" />
                <el-table-column label="短信提醒开关" prop="usePhone" align="center">
                    <template #default="{ row }">
                        <p>登录失效： {{ row.login ? '开' : '关' }}</p>
                        <p>创建失败： {{ row.fail ? '开' : '关' }}</p>
                        <p>登录成功： {{ row.success ? '开' : '关' }}</p>
                    </template>

                </el-table-column>
                <el-table-column label="创建时间" prop="createTime" align="center" />
            </el-table>
            <Pagination :pageable="page" :handleSizeChange="handleSizeChange"
                :handleCurrentChange="handleCurrentChange" />
        </div>
    </div>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import { useTable } from '@/hooks/useTable'
import { dlyUserList } from '@/api/shop'



const searchForm = reactive({
    phone: '',

});
const { tableData, page, loading, resetParams, getList, handleCurrentChange, handleSizeChange } =
    useTable({
        apiFn: dlyUserList,
        params: searchForm
    });


</script>

<style lang="scss" scoped></style>
